package com.banmao.rabbitmq.c2_pubsub;

import com.banmao.rabbitmq.utils.RabbitConstant;
import com.banmao.rabbitmq.utils.RabbitUtil;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;

public class WeatherBureau {

    public static void main(String[] args) throws Exception {

        Connection connection = RabbitUtil.getConnection();
        Channel channel = connection.createChannel();

        // 生产者与交换机绑定，不用关心队列
        channel.basicPublish(RabbitConstant.EXCHANGE_WATHER, "", null, "天气测试".getBytes());

        channel.close();
        connection.close();

    }
}
